package com.katian;

/**
 * User: csavard
 * Date: 13-09-02
 */
public class FileUtils {
    public static String getValidFileName(String fileName) {
        StringBuilder newFileName = new StringBuilder();
        for (char c : fileName.toCharArray()) {
            if (c == '*' || c == '\\' || c == '/' || c == ':' || c == '?' || c == '?' || c == '<' || c == '>' || c == '|') {
                newFileName.append('-');
            } else if (c == '"') {
                newFileName.append("''");
            } else {
                newFileName.append(c);
            }
        }
        return newFileName.toString();
    }
}
